<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String IP = request.getRemoteAddr();
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>工资列表页面</title>
<style>
</style>
</head>
<body>
	<form action="wages/wages.action" method="post" id="form">
	<input type="hidden" name="dtMonth" value="${dtMonth }" id="hidden_dtMonth"/>
		<table border="1">
			<tr>
				<td>
					<select id="select" onchange="toPage('select')">
						<option value="" selected="selected">请选择要查询的月份</option>
						<c:forEach items="${monthList }" var="item" >
							<option value="${item.dtMonth }" 
							/>${item.dtMonth }
						</c:forEach>
					</select>
				</td>
			</tr>
		</table>
		<table border="1">
			<tr>
				<th>编号</th><th>姓名</th><th>职位</th><th>奖金</th><th>补助</th><th>罚款</th><th>工资</th><th>时间</th>
			</tr>
			<c:forEach items="${wageList }" var="item">
				<tr>
					<th>${item.iUserId }</th>
					<th>${item.sName }</th>
					<th>${item.sPosition }</th>
					<th>${item.sBonus }</th>
					<th>${item.sSubsidy }</th>
					<th>${item.sFine }</th>
					<th>${item.sWage }</th>
					<th>${item.dtMonth }</th>
				</tr>
			</c:forEach>
			<tr>
				<td colspan="8">
					<input type="button" value="奖金/罚款管理" onclick="window.location='wages/bonus.action'"/>
					<input type="button" value="发工资" onclick="window.location='wages/pay.action'"/>
				</td>
			</tr>
		</table>
	</form>
</body>
<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
<script type="text/javascript">
function toPage(str){
	var dtMonth = $("#hidden_dtMonth").val();
	if(str == "select"){
		dtMonth = $("#select").val();
	}
	else {
		return false;
	}
	$("#hidden_dtMonth").val(dtMonth);
	document.getElementById("form").submit();
}
</script>
</html>